﻿using System.Web.Mvc;
using ECG.WebUI.Infrastructure;

namespace ECG.WebUI.Attributes
{
    public class CartInfoSession : FilterAttribute, IAuthorizationFilter
    {
        public void OnAuthorization(AuthorizationContext filterContext)
        {
            if (filterContext.HttpContext.Session[SessionConfig.SessionCartInfor] == null)
            {    
                filterContext.Result = new RedirectResult("/Home/Index");
            }
        }
    }
}